CXX=g++

CFLAGS += -std=c++11

LDFLAGS = -lpthread -ljsoncpp -lglog

TARGET = server


SOURCE = ikcp.cpp server.cpp kcp_agent.cpp utils.cpp dispatch.cpp incoming_handle.cpp request_type.cpp parser.cpp \
	 ice_map.cpp client_map.cpp assemble.cpp
	
OBJS = $(SOURCE:%.cpp=obj/%.o)


$(TARGET): $(OBJS)
	$(CXX) -o $@ $(OBJS) $(LDFLAGS) 

obj/%.o:%.cpp
	@mkdir -p obj
	$(CXX) $(CFLAGS) -c $< -o $@

clean:
	rm -fr obj $(OBJS) $(TARGET)
